package cn.lastjune.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.lastjune.dao.EmployeeDao;
import cn.lastjune.pojo.Employee;

@Repository
public class EmployeeDaoImpl extends HibernateDao<Employee, String> implements EmployeeDao
{

    @Override
    public Employee getEmployeeByID(String employeeid)
    {
        return this.get(employeeid);
    }

	@SuppressWarnings("unchecked")
	@Override
	public List<Employee> getByName(String name) {
		String sql="from Employee e where e.employeename like '%"+name+"%'";
		return (List<Employee>)this.getSession().createQuery(sql).list();
	}

}
